package com.kevin.screenslideranimation;

import android.os.Bundle;
import android.app.Fragment;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class ScreenSlidePageFragment extends Fragment {
	private int 	mIndex;
	
	ScreenSlidePageFragment(int nIndex) {
		mIndex = nIndex;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);
		
		Resources res = getResources();
		int[] colors = res.getIntArray(R.array.background_colors);
		
		rootView.setBackgroundColor(colors[mIndex]);
		return rootView;
	}

}
